
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/berryConfig.h.in" "${CMAKE_CURRENT_BINARY_DIR}/berryConfig.h" @ONLY)

MACRO_CREATE_PLUGIN()

TARGET_LINK_LIBRARIES(${PLUGIN_TARGET} optimized PocoUtil debug PocoUtild optimized PocoXML debug PocoXMLd)

ADD_EXECUTABLE(${OSGI_APP} MACOSX_BUNDLE "src/application/berryMain.cpp")
# ADD_EXECUTABLE(${OSGI_APP} "src/application/berryMain.cpp")
TARGET_LINK_LIBRARIES(${OSGI_APP} ${PLUGIN_TARGET} mbilog)
IF (BLUEBERRY_ENABLED_TEST_PLUGINS)
  ADD_DEPENDENCIES(${OSGI_APP} ${BLUEBERRY_ENABLED_TEST_PLUGINS})
ENDIF()

SET(BLUEBERRY_PLUGIN_CACHE_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugin_cache")

CONFIGURE_FILE(src/application/solstice.ini
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}.ini)

INCLUDE(${MITK_SOURCE_DIR}/CMake/CoreHelpers.cmake)

SET_TARGET_PROPERTIES(${OSGI_APP} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/bin/BlueBerry/org.blueberry.osgi/bin")

# MITK_INSTALL_TARGETS(EXECUTABLES ${OSGI_APP} GLOB_PLUGINS )
# MITK_INSTALL_TARGETS(EXECUTABLES ${OSGI_APP} LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/bin)
# MITK_INSTALL_TARGETS(EXECUTABLES ${OSGI_APP} LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/bin PLUGINS ${CMAKE_INSTALL_PREFIX}/bin/BlueBerry/org.blueberry.osgi/bin/liborg_blueberry_osgid.dylib)

